/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author TANGQUOCTUAN
 */
@Entity
@Table(name = "CancelOrderFood", catalog = "TUNGA", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "CancelOrderFood.findAll", query = "SELECT c FROM CancelOrderFood c"),
    @NamedQuery(name = "CancelOrderFood.findByCancelId", query = "SELECT c FROM CancelOrderFood c WHERE c.cancelId = :cancelId"),
    @NamedQuery(name = "CancelOrderFood.findByCancelFee", query = "SELECT c FROM CancelOrderFood c WHERE c.cancelFee = :cancelFee"),
    @NamedQuery(name = "CancelOrderFood.findByCancelDate", query = "SELECT c FROM CancelOrderFood c WHERE c.cancelDate = :cancelDate")})
public class CancelOrderFood implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CancelId", nullable = false)
    private Long cancelId;
    @Basic(optional = false)
    @Column(name = "CancelFee", nullable = false, precision = 19, scale = 4)
    private BigDecimal cancelFee;
    @Basic(optional = false)
    @Column(name = "CancelDate", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date cancelDate;
    @JoinColumn(name = "OderFoodID", referencedColumnName = "OderFoodID", nullable = false)
    @ManyToOne(optional = false)
    private OderFood oderFood;

    public CancelOrderFood() {
    }

    public CancelOrderFood(Long cancelId) {
        this.cancelId = cancelId;
    }

    public CancelOrderFood(Long cancelId, BigDecimal cancelFee, Date cancelDate) {
        this.cancelId = cancelId;
        this.cancelFee = cancelFee;
        this.cancelDate = cancelDate;
    }

    public Long getCancelId() {
        return cancelId;
    }

    public void setCancelId(Long cancelId) {
        this.cancelId = cancelId;
    }

    public BigDecimal getCancelFee() {
        return cancelFee;
    }

    public void setCancelFee(BigDecimal cancelFee) {
        this.cancelFee = cancelFee;
    }

    public Date getCancelDate() {
        return cancelDate;
    }

    public void setCancelDate(Date cancelDate) {
        this.cancelDate = cancelDate;
    }

    public OderFood getOderFood() {
        return oderFood;
    }

    public void setOderFood(OderFood oderFood) {
        this.oderFood = oderFood;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cancelId != null ? cancelId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CancelOrderFood)) {
            return false;
        }
        CancelOrderFood other = (CancelOrderFood) object;
        if ((this.cancelId == null && other.cancelId != null) || (this.cancelId != null && !this.cancelId.equals(other.cancelId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.CancelOrderFood[cancelId=" + cancelId + "]";
    }

}
